package com.ahp.dao.impl;

import java.io.Serializable;
import java.util.List;

import com.ahp.bean.Tast;
import com.ahp.dao.TaskDao;

public class TaskDaoImpl extends GenericDAOImpl<Tast, Integer> implements TaskDao {
	
	public TaskDaoImpl(){
		super(Tast.class);
	}
	
	public TaskDaoImpl(Class<Tast> clazz) {
		super(clazz);
	}

	public Integer save(Tast task) {
		return (Integer) this.getHibernateTemplate().save(task);
	}
	
	@SuppressWarnings("unchecked")
	public List<Tast> find(String hql) {
		return this.getHibernateTemplate().find(hql);
	}

	public Tast load(Serializable id) {
		return (Tast)this.getHibernateTemplate().load(Tast.class, id);
	}
	
	public void delete(Tast task) {
		this.getHibernateTemplate().delete(task);
	}
	
	public Tast get(Class<Tast> entityClass, Serializable id){
		return (Tast)this.getHibernateTemplate().get(entityClass, id);
	}
	
	public void update(Tast task){
		this.getHibernateTemplate().update(task);
	}
}
